package com.ly.heart.domain;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ly.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ly.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 销售订单对象 erp_sale_order
 *
 * @author wutao
 * @date 2024-06-26
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("erp_sale_order")
@ApiModel(value = "erp_sale_order对象", description = "销售订单")
@Data
public class SaleOrderEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 销售订单id
     */
    @TableId(type = IdType.INPUT)
    private String id;

    @ApiModelProperty ("层级（0销售订单 1销售订单新变更单）不用传")
    @TableField ("level")
    private Integer level;

    @ApiModelProperty ("父id(销售订单变更时使用)")
    @TableField ("parent_id")
    private String parentId;

    @ApiModelProperty ("源订单编号(变更单用,直接新增无需)")
    @TableField ("original_order_code")
    private String originalOrderCode;

    @ApiModelProperty ("源单类型(0销售合同 1销售报价单)")
    @TableField ("source_doc_type")
    private String sourceDocType;
    /**
     * 订单编号
     */
    @ApiModelProperty("订单编号")
    @TableField("sale_code")
    @Excel(name = "订单编号")
    private String saleCode;

    /** 变更状态 */
    @ApiModelProperty ("变更状态(0未变更 1已变更)")
    @TableField ("update_state")
    @Excel (name = "变更状态")
    private String updateState;

    /**
     * 单据类型dialog
     */
    @ApiModelProperty("单据类型dialog")
    @TableField("king_doc_type_id")
    @Excel(name = "单据类型dialog")
    private String kingDocTypeId;

    /**
     * 单据编码
     */
    @ApiModelProperty("单据编码")
    @TableField("king_doc_code")
    @Excel(name = "单据编码")
    private String kingDocCode;

    /**
     * 日期
     */
    @ApiModelProperty("日期")
    @TableField("sale_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date saleDate;

    /**
     * 交货方式下拉框
     */
    @ApiModelProperty("交货方式下拉框")
    @TableField("delivery_method")
    @Excel(name = "交货方式下拉框")
    private String deliveryMethod;

    /**
     * 交货地点
     */
    @ApiModelProperty("交货地点")
    @TableField("delivery_address")
    @Excel(name = "交货地点")
    private String deliveryAddress;

    /**
     * 客户dialog
     */
    @ApiModelProperty("客户dialog")
    @TableField("customer_id")
    @Excel(name = "客户dialog")
    private String customerId;

    /**
     * 币别dialog
     */
    @ApiModelProperty("币别dialog")
    @TableField("currency")
    @Excel(name = "币别dialog")
    private String currency;

    /**
     * 价目表dialog
     */
    @ApiModelProperty("价目表dialog")
    @TableField("priceInfo_id")
    @Excel(name = "价目表dialog")
    private String priceinfoId;

    /**
     * 收款条件dialog
     */
    @ApiModelProperty("收款条件dialog")
    @TableField("payment_terms")
    @Excel(name = "收款条件dialog")
    private String paymentTerms;


    @ApiModelProperty("销售组织")
    @TableField("sale_org")
    @Excel(name = "销售组织")
    private String saleOrg;

    /**
     * 销售部门dialog
     */
    @ApiModelProperty("销售部门dialog")
    @TableField("sale_dept")
    @Excel(name = "销售部门dialog")
    private String saleDept;

    /**
     * 销售组
     */
    @ApiModelProperty("销售组")
    @TableField("sale_group")
    @Excel(name = "销售组")
    private String saleGroup;

    /**
     * 销售员
     */
    @ApiModelProperty("销售员")
    @TableField("sale_id")
    @Excel(name = "销售员")
    private String saleId;

    /**
     * 变更原因
     */
    @ApiModelProperty("变更原因")
    @TableField("change_reason")
    @Excel(name = "变更原因")
    private String changeReason;

    @ApiModelProperty("结算币别")
    @TableField("settle_currency")
    @Excel(name = "结算币别")
    private String settleCurrency;

    /**
     * 结算方式dialog
     */
    @ApiModelProperty("结算方式dialog")
    @TableField("settlement_type")
    @Excel(name = "结算方式dialog")
    private String settlementType;

    /**
     * 折扣表dialog
     */
    @ApiModelProperty("折扣表dialog")
    @TableField("discount_info_id")
    @Excel(name = "折扣表dialog")
    private String discountInfoId;

    @ApiModelProperty("整单折扣额")
    @TableField("discount_amount")
    @Excel(name = "整单折扣额")
    private String discountAmount;

    @ApiModelProperty("本位币")
    @TableField("base_currency")
    @Excel(name = "本位币")
    private String baseCurrency;

    /**
     * 税额
     */
    @ApiModelProperty("税额")
    @TableField("tax_amount")
    @Excel(name = "税额")
    private String taxAmount;

    /**
     * 金额
     */
    @ApiModelProperty("金额")
    @TableField("value_tax")
    @Excel(name = "金额")
    private String valueTax;

    /**
     * 保证金比例
     */
    @ApiModelProperty("保证金比例")
    @TableField("margin_level")
    @Excel(name = "保证金比例")
    private String marginLevel;

    /**
     * 保证金
     */
    @ApiModelProperty("保证金")
    @TableField("margin")
    @Excel(name = "保证金")
    private String margin;

    /**
     * 汇率类型dialog
     */
    @ApiModelProperty("汇率类型dialog")
    @TableField("rate_type")
    @Excel(name = "汇率类型dialog")
    private String rateType;

    /**
     * 汇款
     */
    @ApiModelProperty("汇率")
    @TableField("rate")
    @Excel(name = "汇率")
    private String rate;



    /** 税额(本位币) */
    @ApiModelProperty ("税额(本位币)")
    @TableField ("tax_amount_base")
    @Excel (name = "税额(本位币)")
    private String taxAmountBase;

    /** 金额(本位币) */
    @ApiModelProperty ("金额(本位币)")
    @TableField ("money_amount_base")
    @Excel (name = "金额(本位币)")
    private String moneyAmountBase;

    /** 价税合计(本位币) */
    @ApiModelProperty ("价税合计(本位币)")
    @TableField ("total_price_tax_base")
    @Excel (name = "价税合计(本位币)")
    private String totalPriceTaxBase;

    /**
     * 是否含税(0否1是)
     */
    @ApiModelProperty("是否含税(0否1是)")
    @TableField("is_tax")
    @Excel(name = "是否含税(0否1是)")
    private String isTax;

    /**
     * 是否价格税(0否1是)
     */
    @ApiModelProperty("是否价格税(0否1是)")
    @TableField("price_tax")
    @Excel(name = "是否价格税(0否1是)")
    private String priceTax;


    /**
     * 收货方(客户列表)
     */
    @ApiModelProperty("收货方(客户列表)")
    @TableField("receiving_party")
    @Excel(name = "收货方(客户列表)")
    private String receivingParty;

    /**
     * 结算方(客户列表)
     */
    @ApiModelProperty("结算方(客户列表)")
    @TableField("settlement_party")
    @Excel(name = "结算方(客户列表)")
    private String settlementParty;


    /**
     * 付款方(客户列表)
     */
    @ApiModelProperty("付款方(客户列表)")
    @TableField("payer")
    @Excel(name = "付款方(客户列表)")
    private String payer;

    /**
     * 收货地址
     */
    @ApiModelProperty("收货地址")
    @TableField("shipping_address")
    @Excel(name = "收货地址")
    private String shippingAddress;

    /**
     * 收货联系人
     */
    @ApiModelProperty("收货联系人（选择收货方后在调对应的联系人）")
    @TableField("shipping_person")
    @Excel(name = "收货联系人")
    private String shippingPerson;

    /**
     * 收货人姓名
     */
    @ApiModelProperty("收货人姓名")
    @TableField("shipping_person_name")
    @Excel(name = "收货人姓名")
    private String shippingPersonName;


    /**
     * 收货人姓名
     */
    @ApiModelProperty("联系人方式")
    @TableField("shipping_phone")
    @Excel(name = "联系人方式")
    private String shippingPhone;

    @ApiModelProperty("累计收款金额")
    @TableField("total_collection_amount")
    @Excel(name = "累计收款金额")
    private String totalCollectionAmount;

    @ApiModelProperty("累计退款金额")
    @TableField("total_refund_amount")
    @Excel(name = "累计退款金额")
    private String totalRefundAmount;

    @ApiModelProperty("未收款金额")
    @TableField("unpaid_amount")
    @Excel(name = "未收款金额")
    private String unpaidAmount;

    @ApiModelProperty("价税合计总金额")
    @TableField("total_tax_price")
    @Excel(name = "价税合计总金额")
    private String totalTaxPrice;

    /**
     * 0否1是
     */
    @ApiModelProperty ("逻辑删除")
    @TableField ("is_used")
    @Excel (name = "逻辑删除")
    private Integer isUsed;

    @ApiModelProperty ("是否推送金蝶，默认为2未推送，1为已推送")
    @TableField ("is_send")
    private Integer isSend;

    /**
     * 所属公司
     */
    @ApiModelProperty("所属公司")
    @TableField("dept_id")
    @Excel(name = "所属公司")
    private String deptId;

    /**
     * 流程实例id
     */
    @ApiModelProperty("流程实例id")
    @TableField("instance_id")
    @Excel(name = "流程实例id")
    private String instanceId;

    /**
     * 审核状态
     */
    @ApiModelProperty("审核状态")
    @TableField("state")
    @Excel(name = "审核状态")
    private String state;


    @ApiModelProperty("业务type")
    @TableField (exist = false)
    private String businessType;

    @ApiModelProperty("流程模型id")
    @TableField (exist = false)
    private String modelId;

    @ApiModelProperty("单据类型名称")
    @TableField (exist = false)
    private String sourceDocTypeName;

    @ApiModelProperty("客户名称")
    @TableField (exist = false)
    private String customerName;

    @ApiModelProperty("价目名称")
    @TableField (exist = false)
    private String priceInfoName;

    @ApiModelProperty("销售部门")
    @TableField (exist = false)
    private String saleDeptName;

    @ApiModelProperty("销售员名字")
    @TableField (exist = false)
    private String salePersonName;

    @ApiModelProperty("收款条件名称")
    @TableField (exist = false)
    private String paymentTermsName;

    @ApiModelProperty("结算币种名称")
    @TableField (exist = false)
    private String settleCurrencyName;

    @ApiModelProperty("结算方式")
    @TableField (exist = false)
    private String settlementTypeName;

    @ApiModelProperty("物料明细查询详情用到")
    @TableField (exist = false)
    private List<MaterialDetailEntity> materialDetailEntities;

    @ApiModelProperty("销售订单条款")
    @TableField (exist = false)
    private List<OrderPurchaseTermsEntity> orderPurchaseTerms;

    @ApiModelProperty(value = "物流跟踪")
    @TableField (exist = false)
    private List<SaleOrderLogisticsEntity> saleOrderLogisticsEntities;

    @ApiModelProperty("销售订单收款计划")
    @TableField (exist = false)
    private List<SaleCollectionPlanEntity> saleCollectionPlanEntities;


    @ApiModelProperty("合同名称")
    @TableField (exist = false)
    private String contractName;

    @ApiModelProperty(value = "销售员")
    @TableField (exist = false)
    private String salePerson;

    @ApiModelProperty(value = "收货方")
    @TableField (exist = false)
    private String receivingName;
}
